<template>
  <el-form-item v-show="isShow" prop="color" :label="i18nt('designer.setting.color')">
    <el-color-picker v-model="optionModel.color" :disabled="disabled" />
  </el-form-item>
</template>

<script>
export default {
  name: 'ColorEditor',
  inject: ['getDesignerConfig'],
  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object,
    disabled: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    isShow() {
      // 当为button且背景类型为图片时，不显示
      if (
        this.selectedWidget &&
        this.selectedWidget.type === 'button' &&
        this.optionModel.bgType === 2
      ) {
        return false
      }

      return true
    }
  }
}
</script>

<style lang="scss" scoped></style>
